@Configuration
public class RedisConfig {
    @Bean
    public RedisTemplate<Object, Object> redisTemplate(
        RedisConnectionFactory connectionFactory) {
        RedisTemplate<Object, Object> template
            = new RedisTemplate<>();
        // ...
        FastJsonRedisSerializer fastJsonRedisSerializer
            = new FastJsonRedisSerializer(Object.class);
        return template;
    }
}
